package com.example.workflow.exception;

import lombok.Getter;
import org.springframework.http.HttpStatus;

import java.io.Serial;

@Getter
public class ServiceException extends RuntimeException{

    @Serial
    private static final long serialVersionUID = -3303518302920463234L;

    private final int status;

    public ServiceException(int status, String message) {
        super(message);
        this.status = status;
    }

    public ServiceException(int status) {
        this(status, "操作失败");
    }

    public ServiceException(String message) {
        this(HttpStatus.SERVICE_UNAVAILABLE.value(), message);
    }
}

